import { createRouter, createWebHistory } from 'vue-router'
import Home from "@/Home";
import About from "@/About";

const routerHistory = createWebHistory()


// 2.创建VueRouter对象
const routes = [
    {
        path: '',
        // redirect重定向
        redirect: '/home'
    },
    {
        path: '/home',
        component: Home
    },
    {
        path: '/about',
        component: About
    }
]
const router = createRouter({
    history: routerHistory,
    routes
})


// 3.将router对象传入到Vue实例
export default router
